package com.meilai.project.mapper.business.sale;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilai.project.dto.business.saleOrder.SaleQueryGroupDTO;
import com.meilai.project.entity.business.sale.BillSaleGroup;
import com.meilai.project.vo.business.sale.BillSaleGroupRelationIdsVO;
import com.meilai.project.vo.business.sale.BillSaleVO;
import com.meilai.project.vo.business.sale.ContractCustomerVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 销售分组表 Mapper 接口
 * </p>
 *
 * @author xhy
 * @since 2022-12-05
 */
public interface BillSaleGroupMapper extends BaseMapper<BillSaleGroup> {

    /**
     * 根据到款id，查找分组ids
     */
    List<BillSaleGroupRelationIdsVO> getGroupIdsByAcId(@Param("acId") Long acId);

    /**
     * 根据dto，找分组ids
     */
    List<BillSaleGroupRelationIdsVO> getGroupIdsByDto(@Param("dto") SaleQueryGroupDTO dto);

    List<BillSaleVO> seleList(@Param("user_id") Long user_id, @Param("customer_id") Long customer_id, @Param("group_id") Long group_id);

    ContractCustomerVO getContractAndCustomerByGroupId(@Param("contract_id") Long contract_id);

    List<ContractCustomerVO> getContractAndCustomerByGroupIds(@Param("contract_ids") List<Long> contract_ids);
}
